package com.zhentao;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.zhentao.user.ChargeUserFeignApi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;


/**
 * @ClassName: ChargeAdminUserApplication
 * @Author: 振涛教育_Q
 * @Date: 2024/12/26 19:17
 */
@SpringBootApplication
@MapperScan("com.zhentao.mapper")
@EnableDiscoveryClient
@RefreshScope
@EnableFeignClients(clients = ChargeUserFeignApi.class )
public class ChargeAdminUserApplication {
    public static void main(String[] args) {
        SpringApplication.run(ChargeAdminUserApplication.class, args);
    }


    @Bean
    public MybatisPlusInterceptor interceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
